import { Credentials } from './type'

export const getCredentials = function (withCredentials?: boolean, credentials?: Credentials) {
    if (!withCredentials) {
        return 'same-origin'
    }
    if (withCredentials === true) {
        return 'include'
    }
    if (withCredentials === false) {
        return 'omit'
    }
    return credentials
}
